﻿CREATE TABLE [dbo].[WxUser]
(
	[Id] BIGINT NOT NULL PRIMARY KEY IDENTITY, 
    [OpenId] NVARCHAR(50) NULL, 
    [SubscribeDt] DATETIME NULL, 
    [UnsubscribeDt] DATETIME NULL, 
    [LastActiveDt] DATETIME NULL, 
    [IsBkMember] INT NULL, 
    [BkMemberId] BIGINT NULL,
	[RecStatus] INT NOT NULL, 
    [RecCreateDt] DATETIME NOT NULL, 
    [RecUpdateDt] DATETIME NULL, 
    [RecDeleteDt] DATETIME NULL, 
    [Scope] NVARCHAR(50) NULL
)

GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'微信用户信息表',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxUser',
    @level2type = NULL,
    @level2name = NULL
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'主键，自增长',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxUser',
    @level2type = N'COLUMN',
    @level2name = N'Id'
GO

EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'微信OpenId',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxUser',
    @level2type = N'COLUMN',
    @level2name = 'OpenId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'关注时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxUser',
    @level2type = N'COLUMN',
    @level2name = N'SubscribeDt'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'取消关注时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxUser',
    @level2type = N'COLUMN',
    @level2name = N'UnsubscribeDt'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'最近活跃时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxUser',
    @level2type = N'COLUMN',
    @level2name = N'LastActiveDt'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'是否已绑定倍康会员，1：是，0：不是',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxUser',
    @level2type = N'COLUMN',
    @level2name = N'IsBkMember'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'已绑定的倍康会员',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxUser',
    @level2type = N'COLUMN',
    @level2name = N'BkMemberId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录状态, 1：正常；2：删除',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxUser',
    @level2type = N'COLUMN',
    @level2name = N'RecStatus'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录创建时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxUser',
    @level2type = N'COLUMN',
    @level2name = N'RecCreateDt'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录上次修改时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxUser',
    @level2type = N'COLUMN',
    @level2name = N'RecUpdateDt'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录删除时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxUser',
    @level2type = N'COLUMN',
    @level2name = N'RecDeleteDt'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'用户所属；Hosp - 医院微信，Platform - 倍康平台微信',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'WxUser',
    @level2type = N'COLUMN',
    @level2name = N'Scope'